Skip to content

Modernize CI workflow (GitHub Actions v4/v5, test matrix)#13

Merged
renecannao merged 4 commits intomasterfrom
phase1/task3-ci-modernization
Mar 23, 2026
Merged

Modernize CI workflow (GitHub Actions v4/v5, test matrix)#13
renecannao merged 4 commits intomasterfrom
phase1/task3-ci-modernization

Conversation

@renecannao
Copy link
Copy Markdown

Summary

  • Replace single monolithic CI job with separate lint, test, and build jobs
  • Upgrade GitHub Actions from v2 to v4/v5 (checkout@v4, setup-go@v5)
  • Add Go version matrix (1.22, 1.23) and OS matrix (ubuntu-latest, macos-latest) for tests
  • Add golangci-lint, govulncheck, and copyright check to lint job
  • Build job depends on lint and test passing, then verifies the executable exists

Closes #3

Copilot AI review requested due to automatic review settings March 23, 2026 19:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Modernizes the project’s CI setup by splitting the existing GitHub Actions workflow into dedicated lint, test (matrix), and build jobs, while also updating the Go toolchain baseline and related tooling/config.

Changes:

  • Replaced the single CI job with separate lint/test/build jobs and upgraded Actions to checkout@v4 + setup-go@v5.
  • Added a Go/OS test matrix (Go 1.22/1.23 × ubuntu/macos) and introduced golangci-lint + govulncheck in CI.
  • Bumped go.mod to Go 1.22 and updated module dependencies (plus a few small Go code cleanups).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
.github/workflows/all_tests.yml New multi-job workflow with lint/test matrix/build stages.
.golangci.yml Adds golangci-lint configuration used by the new lint job.
go.mod Raises Go version to 1.22 and updates direct/indirect dependencies.
go.sum Syncs module checksums to the updated dependency set.
.goreleaser.yaml Updates GoReleaser config (v2 schema + archive naming changes).
ops/downloads.go Simplifies error formatting in tarball lookup path.
ts/commands.go Fixes invalid regexp flags used in testscript helper.
downloads/tarball_registry.go Removes Go build tags near embedded tarball registry.
Comments suppressed due to low confidence (1)

downloads/tarball_registry.go:19

  • Most files that use //go:embed in this repo are guarded with //go:build go1.16 (e.g. common/version.go, cookbook/cookbook_templates.go). This file now uses //go:embed without that build tag, which is inconsistent with the existing pattern. Either keep the tag here for consistency, or remove the go1.16 build tags across the codebase if they’re no longer needed after raising the module to Go 1.22.
package downloads

import (
	_ "embed"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ops/downloads.go
if err != nil {
return downloads.TarballDescription{}, fmt.Errorf(fmt.Sprintf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
version, flavor, OS, minimal, newest, guessLatest, err))
return downloads.TarballDescription{}, fmt.Errorf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error should wrap the underlying err so callers can use errors.Is/As to inspect it. Use %w instead of %s for err (and consider starting the message with a lowercase letter to follow Go error conventions).

Suggested change
return downloads.TarballDescription{}, fmt.Errorf("Error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %s",
return downloads.TarballDescription{}, fmt.Errorf("error getting version %s (%s-%s)[minimal: %v - newest: %v - guess: %v]: %w",

Copilot uses AI. Check for mistakes.
Comment thread .goreleaser.yaml
amd64: x86_64
- formats: ['tar.gz']
name_template: >-
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

archives.name_template now produces assets like dbdeployer_<ver>_<os>_<arch>.tar.gz. This doesn't match the repository’s installer expectations (e.g. scripts/dbdeployer-install.sh downloads dbdeployer-<ver>.<os>.tar.gz). Either align the GoReleaser naming with the existing release/install contract, or update the installer/docs accordingly to avoid breaking installs from GitHub Releases.

Suggested change
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
{{ .ProjectName }}-{{ .Version }}.{{ .Os }}

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +25
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...
- name: Copyright check
run: ./scripts/sanity_check.sh copyright
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous CI flow (scripts/ci.sh) ran ./scripts/sanity_check.sh (gofmt, go vet, version check, etc.). The new workflow only runs a copyright check + golangci-lint, and the current .golangci.yml does not enable a gofmt/gofumpt linter. If the goal is "no coverage lost" from the old CI, consider running ./scripts/sanity_check.sh (or at least restoring the gofmt/version checks) as part of the lint job.

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +22
version: latest
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using version: latest for golangci-lint makes CI non-reproducible and can cause sudden failures when a new linter release ships. Pin the golangci-lint version (and similarly consider pinning govulncheck) to a known-good version, then update it intentionally.

Suggested change
version: latest
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
version: v1.61.0
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@v1.1.1

Copilot uses AI. Check for mistakes.
Comment thread .golangci.yml
- ineffassign
- staticcheck
- unused
- gosec
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old CI sanity check explicitly enforced gofmt -l. With this linter set, formatting issues won’t be caught unless you add a formatter linter (e.g. gofmt/gofumpt/goimports) or run gofmt separately in CI.

Suggested change
- gosec
- gosec
- gofmt

Copilot uses AI. Check for mistakes.
Comment thread ts/commands.go Outdated
reLines := regexp.MustCompile(`(?sg)(^.*ERROR.*)`)
reLines := regexp.MustCompile(`(?s)(^.*ERROR.*)`)
errorLines := reLines.FindAll(contents, -1)
ts.Fatalf("ERRORs found in %s (%s)\n", logFile, errorLines)
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the neg && hasError branch, errorLines is a [][]byte, but the format string uses %s. This will print a formatting error (e.g. %!s([][]uint8=...)) instead of the matched lines. Consider converting the matches to strings and joining them, or use a verb that can print slices (e.g. %q/%v).

Suggested change
ts.Fatalf("ERRORs found in %s (%s)\n", logFile, errorLines)
var errorLinesStrs []string
for _, line := range errorLines {
errorLinesStrs = append(errorLinesStrs, string(line))
}
ts.Fatalf("ERRORs found in %s (%s)\n", logFile, strings.Join(errorLinesStrs, " | "))

Copilot uses AI. Check for mistakes.
@renecannao
Copy link
Copy Markdown
Author

@gemini-code-assist review

@renecannao
Copy link
Copy Markdown
Author

@claude review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the project's Go version from 1.18 to 1.22 and updates numerous Go dependencies. It introduces a new .golangci.yml configuration to enable static analysis linters for improved code quality. The .goreleaser.yaml configuration is updated for enhanced release automation, including changes to archive formats and changelog filters. Additionally, an outdated Go build tag is removed from downloads/tarball_registry.go, an error message formatting is simplified in ops/downloads.go, and a redundant flag is removed from a regular expression in ts/commands.go.

@renecannao
Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

Warning

Rate limit exceeded

@renecannao has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 57ec19e7-8d9f-4414-aa2a-8dfa1f9dac11

📥 Commits

Reviewing files that changed from the base of the PR and between 88f8fda and e710427.

📒 Files selected for processing (4)
  • .github/workflows/all_tests.yml
  • .golangci.yml
  • .goreleaser.yaml
  • mkreadme/readme_template.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch phase1/task3-ci-modernization

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@renecannao renecannao force-pushed the phase1/task3-ci-modernization branch from 596fb16 to e710427 Compare March 23, 2026 20:16
@renecannao renecannao merged commit d51b93e into master Mar 23, 2026
0 of 5 checks passed
@renecannao renecannao deleted the phase1/task3-ci-modernization branch March 23, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modernize CI workflow (GitHub Actions v4/v5, test matrix)

2 participants